//
//  YHAlertView.h
//  MoreCoin
//
//  Created by 林宁宁 on 2019/10/28.
//  Copyright © 2019 MoreCoin. All rights reserved.
//

#import "YHPopBaseView.h"
#import "NSMutableAttributedString+YH.h"

NS_ASSUME_NONNULL_BEGIN

@interface YHAlertView : YHPopBaseView


@property (retain, nonatomic,readonly) UILabel * contentText;//内容
@property (retain, nonatomic,readonly) UILabel * contentHeadTitle;//顶部标题
@property (retain, nonatomic, readonly) UIView * contentBtnsView;//底部按钮视图

/** 标题距顶部的间距 默认20*/
@property (assign, nonatomic) NSInteger titleToTopSpace;
/// 标题到内容区的间距 8
@property (assign, nonatomic) CGFloat titleToContentSpace;
//内容和按钮之间间隙 默认 8
@property (assign, nonatomic) NSInteger contentToButtonSpace;

//按钮垂直分布间隙 默认 5
@property (assign, nonatomic) NSInteger btnVerticalSpace;
//按钮距底部边距间隙 默认 10
@property (assign, nonatomic) NSInteger btnBottomSpace;
//只有一个按钮时候 距底部边距间隙 默认 0
@property (assign, nonatomic) NSInteger onlyOneBtnBottomSpace;


/** 显示文本区域的最小高度*/
@property (assign, nonatomic) NSInteger showHeightMin;
/** 显示文本区域的最大高度 内容不够显示 滚动方式*/
@property (assign, nonatomic) NSInteger showHeightMax;

/** 点击按钮之后关闭 弹窗 默认YES*/
@property (assign, nonatomic) BOOL tapBtnToClose;

//显示按钮的分割线
@property (assign, nonatomic) BOOL showBtnsSeparationLine;
//按钮垂直分布
@property (assign, nonatomic) BOOL isBtnVerticalLayout;
//按钮垂直分布左右间隙 默认 0
@property (assign, nonatomic) NSInteger btnVerticalEdgeSpace;


//按钮高度 默认40
@property (assign, nonatomic) NSInteger btnHeight;
//弹窗的宽度
@property (assign, nonatomic) CGFloat contentWidth;


@property (assign, nonatomic) NSTextAlignment headTitleAligment;
@property (assign, nonatomic) NSTextAlignment contentAligment;

/// 内容布局是否居中 默认上对其
@property (assign, nonatomic) BOOL contentVerticalLayoutCenter;


//@property (retain, nonatomic, readonly) UIColor * colorHeadTitle;
//@property (retain, nonatomic, readonly) UIColor * colorContentText;
//@property (retain, nonatomic, readonly) UIFont * fontHeadTitle;
//@property (retain, nonatomic, readonly) UIFont * fontContentText;



/**
 添加按钮
 从左到右 从上到下
 */
- (void)addBtnBlock:(void(^)(UIButton * passBtn))btnBlock action:(void(^)(YHAlertView * alertV))action;

- (void)addBtnTitle:(NSString *)btnTitle action:(void(^_Nullable)(YHAlertView * alertV))action;
//- (void)addBtnGrayTitle:(NSString *)btnTitle action:(void(^_Nullable)(YHAlertView * alertV))action;
- (void)addBtnBlueTitle:(NSString *)btnTitle action:(void(^_Nullable)(YHAlertView * alertV))action;
- (void)addBtnRedTitle:(NSString *)btnTitle action:(void (^_Nullable)(YHAlertView * alertV))action;
- (void)addBtnOrangeTitle:(NSString *)btnTitle action:(void (^_Nullable)(YHAlertView * alertV))action;
- (void)addBtnTitle:(NSString *)btnTitle;
- (void)addBtnBlueTitle:(NSString *)btnTitle;

- (void)addBtnBack;
- (void)addBtnCancel;


//- (void)addBtnBgOrangeCornerTitle:(NSString *)btnTitle action:(void(^)(YHAlertView * alertV))action;
//- (void)addBtnBgLineBorderCornerTitle:(NSString *)btnTitle action:(void(^)(YHAlertView * alertV))action;

/**
 添加顶部标题
 */
- (void)addHeadTitle:(NSString *)title attTitle:(void(^ _Nullable)(NSMutableAttributedString * attTitle))attBlock;
- (void)addHeadTitle:(NSString *)title;
- (void)addHeadImageName:(NSString *)imageName;


/**
 * 添加背景图，宽度可更改
 **/
- (void)addHeadBackgroundImage:(UIImage *)image;


/**
 添加内容
 */
- (void)addContent:(NSString *)content attContent:(void(^ _Nullable)(NSMutableAttributedString * attContent))attBlock;
- (void)addContent:(NSString *)content;



/** 添加自定义视图显示弹窗
 替代内容显示框*/
- (void)addCustomView:(UIView *)customV;

- (void)addCloseBtn;
- (void)addCloseBtnWithImgName:(NSString *)imgName;

/** 给子类视图用*/
- (void)buildOtherContentV;




/// 只有顶部大标题显示
- (void)styleSingleHeadTitleShow;

/// 提示窗
/// @param title 标题
/// @param message 信息
/// @param cancelTitle 取消标题
/// @param actionTitles 事件标题，数组
/// @param attributedBlock 信息富文本
/// @param handler 点击事件回调，包括取消事件
+ (void)alertWithTitle:(NSString * _Nullable)title message:(NSString * _Nullable)message cancelTitle:(NSString  *)cancelTitle actionTitles:(NSArray <NSString *> *)actionTitles attributedBlock:(void (^ _Nullable)(NSMutableAttributedString *att))attributedBlock handler:(void(^)(NSUInteger buttonIndex, NSString *buttonTitle))handler;


+ (void)showConfig:(void(^)(YHAlertView * alertView))config;

@end

NS_ASSUME_NONNULL_END
